<?php
define('IN_ADMINCP', TRUE);
define('ADMINCP_PATH', dirname(__FILE__));
define('APP_PATH', dirname(ADMINCP_PATH));
require APP_PATH . '/app.php';
$heivrid = $_G['gp_heivrid'];
$admin = fetch('admincp_member', $heivrid, 'username');

if(empty($admin)){
	$admin = fetch('customer',$heivrid,'account');
}
$avatar = $admin ? avatar($admin['avatar']) : '';
if( $_G['gp_jsonp'] ){
	jsonp($avatar);
}else if( $_G['gp_src'] ){
	echo $avatar;
}else if( $_G['gp_img'] ){
	header("Content-Type:image/jpg");
	$file = APP_PATH . $avatar;
	if( is_file($file) ){
		echo file_get_contents($file);
	}
}